using FluentNHibernate.Mapping;
using Munim.Fame.Core.DomainModels;

namespace Munim.Fame.DataAccess.NHibernate.Mapping
{
    public sealed class CrewMap : ClassMap<Crew>
    {
        public CrewMap()
        {
            Id(c => c.Id);
            Map(c => c.Name);
            DiscriminateSubClassesOnColumn("Type");
            HasManyToMany(m => m.Medias).Cascade.All().Table("CrewMap").ExtraLazyLoad();
        }
    }
}